import pickle
from config import Config
import json
import numpy as np
import mxnet.gluon.nn as nn
import mxnet.ndarray as nd
import mxnet as mx

print(Config.char_emb_file)
out = json.load(open(Config.char_emb_file))
out = np.array(out)
print(len(out[10]))
print(len(out))
print(out.shape)
print(out)

emb = nn.Embedding(out.shape[0], out.shape[1])
emb.initialize(ctx=mx.cpu())
emb.weight.set_data(out)
x = nd.array([[1, 2], [1,3]])
emb(x)
# import time
# time.sleep(10)